package test;

import java.lang.reflect.Array;

/**
 * @author zhu
 * @date 2024-03-27
 */
public class MainTest01 {
    public static void main(String[] args) {
        Object obj = Array.newInstance(String.class, 2);

        Array.set(obj,0,"张三");
        Array.set(obj,1,"李四");

        for (int i = 0; i < Array.getLength(obj); i++) {
            System.out.println(Array.get(obj,i));
        }
    }
}
